-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Indexing permissions as part of the Elastic Agent policy #169
Indexing permissions as part of the Elastic Agent policy #169
Conversation
💚 Build Succeeded
Expand to view the summary
Build stats
Test stats 🧪
Trends 🧪 |
} | ||
|
||
m := make(smap.Map) | ||
m["index"] = idx |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hope we can get rid of this bit as it is planned that Kibana will add the index
part to the output so we don't need to do the additional processing here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, Alejandro reached out about the upcoming change. Might add more things here then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this change looks good. See my inline comment about fetching the policy from elasticsearch.
internal/pkg/dl/policies.go
Outdated
@@ -79,3 +90,18 @@ func CreatePolicy(ctx context.Context, bulker bulk.Bulk, policy model.Policy, op | |||
} | |||
return bulker.Create(ctx, o.indexName, "", data) | |||
} | |||
|
|||
// FindPolicyByID find policy by ID | |||
func FindPolicyByID(ctx context.Context, bulker bulk.Bulk, policyID string) (policy model.Policy, err error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The policy.Monitor
keeps the latest revision of each policy in memory. It would be better to fetch the policy from there instead of going to elasticsearch, as fleet-server already has it cached in memory.
…or policy updates.
This pull request is now in conflicts. Could you fix it @aleksmaus? 🙏
|
@aleksmaus I see this got merged but elastic/kibana#94591 is still open. How is the current behaviour? |
This reverts commit 81c6d16.
What does this PR do?
Implements the Indexing permissions as part of the Elastic Agent policy
#101
policy_output_permissions_hash
into the Agent document that stores the hash ofoutput_permissions
from the policy.output_permissions
default
namespace in order to create the role descriptors for the output API key generation.output_permissions
upon every checking. If the hash doesn't match with the stored in the agent document the new key is generated.This PR:
output_permissions
changes, pending on further kibana changes.Should only be merged after the corresponding kibana changes:
elastic/kibana#94591
Why is it important?
Addresses: #101
Checklist
Related issues
Screenshots